package com.shopnight.service;



import com.shopnight.redisEntity.Cart;
import com.shopnight.redisEntity.CartItem;
import com.shopnight.redisEntity.CheckItemVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {
    //添加购物
    CartItem addToCart(Long orderId, Integer num) throws ExecutionException, InterruptedException;
    //获取某个购物项
    CartItem getCartItem(Long skuId);

    /**
     * 获取整个购物车
     * @return
     * @throws ExecutionException
     * @throws InterruptedException
     */
    Cart getCart(Long orgId) throws ExecutionException, InterruptedException;

    //勾选和购物项
    void checkItem(List<CheckItemVo> checkItemVos);

    //修改购物项数量
    void changeItemCount(Long skuId, Integer num);

    //删除购物项
    void deleteItem(Long skuId);

    //批量删除购物项
    void deleteItems(Long[] orderIds);

    //根据用户id删除购物车
    void userIdByDelete(String userId);
}
